Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add @value to context when iterating over maps/iterables #540

Closed
wants to merge 2 commits into from

Conversation

giflw
Copy link
Contributor

@giflw giflw commented Sep 22, 2016

Add @value to context to more semantic the access to map key/value pairs

Add @value to context to more semantic the access to map key/value pairs
@coveralls
Copy link

coveralls commented Sep 22, 2016

Coverage Status

Coverage increased (+0.004%) to 86.214% when pulling abfadde on giflw:patch-1 into 1f6c48e on jknack:master.

@jknack
Copy link
Owner

jknack commented Sep 22, 2016

Hello @giflw thanks for your pull. Is this supported by handlebarsjs?

If so, then can you please add a two test: one with list input the other with a hash/map input.

@giflw
Copy link
Contributor Author

giflw commented Sep 22, 2016

Hi @jknack . I have no idea if this is supported on JS. I was just using the Java version now, and seems to me that it would be semantically better than using {{this}} to access the value of the map entry.

@jknack
Copy link
Owner

jknack commented Sep 22, 2016

Yea, just tried at http://tryhandlebarsjs.com/ and isn't supported by handlebars.js

This creates incompatibilities between the two implementations so don't think is a good idea to add this for now.

That's being said, let's keep this pull open and if more users find it valuable then I will merge.

Thanks again.

@giflw
Copy link
Contributor Author

giflw commented Sep 22, 2016

Maybe this change can be made in JS version too. I just need to have a little more time to do that. I think this is the file that need to be modified: https://github.com/wycats/handlebars.js/blob/e8ceafa6525a5d41a20aa74dfe24bf99d0bc2fcd/lib/handlebars/helpers/each.js. This way, there will be no incompatibilities.

@jknack
Copy link
Owner

jknack commented Sep 22, 2016

That will be ideal, yes!

@giflw
Copy link
Contributor Author

giflw commented Sep 22, 2016

I made a proposal there handlebars-lang/handlebars.js#1253.

@coveralls
Copy link

coveralls commented Sep 23, 2016

Coverage Status

Coverage increased (+0.008%) to 86.218% when pulling c42c36e on giflw:patch-1 into 1f6c48e on jknack:master.

@giflw giflw changed the title Add @value to context when iterating over maps Add @value to context when iterating over maps/iterables Sep 27, 2016
@jknack jknack added this to the 4.0.7 milestone May 24, 2018
@jknack jknack added the invalid label May 24, 2018
@jknack
Copy link
Owner

jknack commented May 24, 2018

Rejected as explained in related handlebars.js issue

@jknack jknack closed this May 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants